<template>
  <div>
      <div class="title">热销推荐</div>
      <div class="item-wrapper">
        <router-link
          tag="div"
          :to="'/detail/' + item.id"
          class="item border-bottom"
          v-for="item in recommendList"
          :key="item.id"
        >
            <img class="item-img" :src="item.imgUrl" />
            <div class="item-info">
                <p class="item-title">{{item.title}}</p>
                <p class="item-desc">{{item.desc}}</p>
                <button class="item-bottom">查看详情</button>
            </div>
        </router-link>
      </div>
      <div class="allProduction">查看所有产品</div>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: {
      type: Array
    }
  },
  data () {
    return {
    }
  }
}
</script>

<style lang="stylus" scope>
@import '~styles/varibles.styl'
@import '~styles/mixins.styl'
.allProduction
  color: $buttonBgColor
  height: .8rem
  line-height: .8rem
  text-align: center
.title
  background: #EDEDED
  line-height: .8rem
  text-indent: .2rem
 .item-wrapper
  .item
   display: flex
   flex-direction: row
   height: 1.9rem
   .item-info
    min-width: 0
    flex: 1
    padding: .1rem
    .item-title
     font-size: .32rem
     height: .44rem
     line-height: .44rem
    .item-desc
     font-size: .24rem
     color: $darkTextColor
     height: .44rem
     line-height: .44rem
     ellipsis()
    .item-bottom
     color: #fff
     background: $buttonBgColor
     border-radius: .1rem
     padding: .08rem .2rem
   .item-img
    overflow: hidden
    width: 1.7rem
    padding: .1rem
    height: 1.7rem
</style>
